package org.yhx.learning.verticle.eventbus;/*
 * Copyright (C), 2024, bigmoon
 * FileName:
 * Author:   bigmoon
 * Date:     2024/9/5 11:23
 * Description: //模块目的、功能描述
 * History: //修改记录
 * &lt;author&gt;      &lt;time&gt;      &lt;version&gt;    &lt;desc&gt;
 * 修改人姓名             修改时间            版本号                  描述
 */

import io.vertx.core.AbstractVerticle;
import io.vertx.core.json.JsonObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ListenerLog extends AbstractVerticle {

    private static final Logger LOGGER = LoggerFactory.getLogger(ListenerLog.class);

    @Override
    public void start() throws Exception {
        vertx.eventBus().<JsonObject>consumer("sensor.updates", (msg) -> LOGGER.info("接收消息:{},body:{}", msg.address(), msg.body().encode()));
    }
}
